<?php
/**
 * Minhlog Domain_Mapper 用户类
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 *
 * @category   Domain
 * @package    Domain_DataMapper
 * @copyright  Copyright (c) 2009-2010 Minh.Shu@gmail.com
 * @license    New BSD License
 * @author     Minh.Shu
 * @version    $Id: User.php 2 2010-01-17 13:49:08Z Minh.Shu $
 *
 */


class Domain_DataMapper_User extends Domain_DataMapper_Abstract
{
    protected $_tableClassName = 'Domain_Table_User';

    protected $_dataMapper = array(
            'userId'              => 'user_id',
            'userName'            => 'username',
            'nickName'            => 'nickname',
            'password'            => 'password',
            'email'               => 'email',
            'registerTime'        => 'register_time',
            'lastLoginTime'       => 'last_login_time'
    );

    /**
     * 查询全部用户数据
     * @return object|void
     */
    public function fetchAllUser()
    {
        return $this->findAll($this->fetchAllUserStatement());
    }

    /**
     * 封装查询全部用户信息SQL对象
     * @return Zend_Db_Table_Select
     */
    private function fetchAllUserStatement()
    {
        $select = $this->getTable()->select();
        return $select;
    }


}